// src/api/index.ts
import mockRequests from "./mockIndex";
import { MockingResponse } from "@/types/mockTypes";
import { ParkingData } from "../store/modules/parking"; // 导入 ParkingData 类型

// interface MockingResponse {
//   code: number;
//   data: MockingData[]; // ParkingData 的类型需要根据您的数据结构定义
// }

// 获取停车数据的接口
export const reqGetMockingList = async (): Promise<MockingResponse> => {
  console.log("调用api::reqGetMockingList");
  const response = await mockRequests({ url: "/mockingList", method: "get" });
  return response.data; // 返回数据
};

interface ParkingResponse {
  code: number;
  data: ParkingData[]; // ParkingData 的类型需要根据您的数据结构定义
}

// 获取停车数据的接口
export const reqGetParkingList = async (): Promise<ParkingResponse> => {
  const response = await mockRequests({ url: "/parkingList", method: "get" });
  return response.data; // 返回数据
};
